package com.fs;

import org.mybatis.spring.annotation.MapperScan;
import org.springframework.boot.SpringApplication;
import org.springframework.boot.autoconfigure.SpringBootApplication;
import org.springframework.cache.annotation.EnableCaching;
import org.springframework.context.ConfigurableApplicationContext;
import org.springframework.core.env.Environment;

@EnableCaching  //开启redis缓存
@SpringBootApplication
@MapperScan(value = "com.fs.mapper")
public class FruitShopClientApplication {

    public static void main(String[] args) {

        ConfigurableApplicationContext context = SpringApplication.run(FruitShopClientApplication.class, args);
        Environment environment = context.getBean(Environment.class);
        String port = environment.getProperty("server.port");
        String path = environment.getProperty("server.servlet.context-path");


        System.out.println("启动成功，访问链接：\nhttp://localhost:"+port+path);
        System.out.println("Swagger：\nhttp://localhost:"+port+path+"/swagger-ui.html");
    }
}
